package com.yugao.fintech.libra.auth.api.service;

import com.yugao.fintech.meheco.core.constant.SecurityConstants;
import com.yugao.fintech.meheco.core.constant.ServiceIdConstants;
import com.yugao.fintech.meheco.core.domain.ResultVO;
import com.yugao.fintech.libra.auth.api.factory.RemoteRoleFallbackFactory;
import com.yugao.fintech.libra.auth.model.SysRole;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

/**
 * 用户服务
 */
@FeignClient(contextId = "remoteRoleService", value = ServiceIdConstants.SYSTEM_SERVICE, fallbackFactory = RemoteRoleFallbackFactory.class)
public interface RoleFeignApi {

    @GetMapping("/role/inner/info/{id}")
    public ResultVO<SysRole> getRoleInfoById(@PathVariable("id") Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/role/inner/all/list")
    public ResultVO<List<SysRole>> getRoleAll(@RequestBody SysRole sysRole, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
